//
//  NSAttributedStringExtend.m
//  etionMisc
//
//  Created by wjxfhxy on 14-9-25.
//  Copyright (c) 2014年 GuangZhouXuanWu. All rights reserved.
//

#import "NSAttributedStringExtend.h"

@implementation NSAttributedString (CaleSzie)

- (CGSize)attributeWrapStringSizeForContainWidth:(CGFloat)containWidth
{
    CGSize size = [self boundingRectWithSize:CGSizeMake(containWidth, INT_MAX) options:NSStringDrawingUsesFontLeading|NSStringDrawingUsesLineFragmentOrigin context:nil].size;
    return CGSizeMake(ceil(size.width), ceil(size.height));
}

- (CGSize)attributeStringSizeForContainWidth:(CGFloat)containWidth
{
    CGSize size = [self boundingRectWithSize:CGSizeMake(containWidth, INT_MAX) options:NSStringDrawingUsesFontLeading context:nil].size;
    return CGSizeMake(ceil(size.width), ceil(size.height));
}

@end
